home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / TestParts / DragText / DragInit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-01  |  1.3 KB  |  70 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        DragInit.cpp
  3.  
  4.     Contains:    Init routines for DragText part
  5.  
  6.     Owned by:    Eric House
  7.  
  8.     Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <2>     5/24/96    jpa        1246074: Call Mwerks init/terminate fns for
  13.                                     native exceptions.
  14.  
  15.     To Do:
  16.     In Progress:
  17.  
  18. */
  19.  
  20.  
  21. /* #include <somcls.xh> */
  22. #include <som.xh>
  23. #include <somobj.xh>
  24.  
  25. #ifndef _ALTPOINT_
  26. #include <AltPoint.h>
  27. #endif
  28.  
  29. #ifndef _USERSRCM_
  30. #include <UseRsrcM.h>
  31. #endif
  32.  
  33. #ifndef _ODMEMORY_
  34. #include <ODMemory.h>
  35. #endif
  36.  
  37. #ifndef SOM_AppleTestDrag_DragText_xh
  38. #include "DragText.xh"
  39. #endif
  40.  
  41.  
  42. #ifdef __MWERKS__
  43. extern "C" {
  44.     void __initialize();        // From Metrowerks runtime library, Startup.c
  45.     void __terminate();
  46. }
  47. #endif
  48.  
  49.  
  50. extern "C" pascal OSErr DragTextCFMInit (CFragInitBlockPtr initBlkPtr);
  51. extern "C" pascal void  DragTextCFMTerminate( );
  52.  
  53. pascal OSErr DragTextCFMInit (CFragInitBlockPtr initBlkPtr)
  54. {
  55. #ifdef __MWERKS__
  56.     __initialize();        // Initialize static data and construct any global objects
  57. #endif
  58.     OSErr err;
  59.     if( (err=InitODMemory()) != noErr ) return err;
  60.     return InitLibraryResources(initBlkPtr);
  61. }
  62.  
  63. pascal void DragTextCFMTerminate( )
  64. {
  65.     CloseLibraryResources();
  66. #ifdef __MWERKS__
  67.     __terminate();        // Destruct static objects & clean up exception tables
  68. #endif
  69. }
  70.